package com.example.demo.service.Impl;

import com.example.demo.mapper.StaffMapper;
import com.example.demo.pojo.Staff;
import com.example.demo.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Project:demo
 * @Description:
 * @Author: Mr.Hunter
 * @Date:2023/5/25/17:11
 */
@Service
public class StaffServiceImpl implements StaffService {

    @Autowired
    private StaffMapper staffMapper;


    @Override
    public List<Staff> selectStaffAllByStore(Integer shopID) {
        return staffMapper.selectStaffAllByStore(shopID);
    }

    @Override
    public List<Staff> selectAllStaffById(Integer staffId) {
        return staffMapper.selectAllStaffById(staffId);
    }

    @Override
    public List<Staff> selectAllStaffByName(String staffName) {
        return staffMapper.selectAllStaffByName(staffName);
    }

    @Override
    public void insertStaff(String name, String mail, String pos,Integer shopID) {
        staffMapper.insertStaff(name, mail, pos,shopID);
    }

    @Override
    public void updateStaffById(Integer staffId, String name, String mail, String pos, Integer shopID) {
        staffMapper.updateStaffById( staffId, name, mail, pos, shopID);
    }

    @Override
    public void updateStaffByName(String name, String mail, String pos, Integer shopID) {
        staffMapper.updateStaffByName( name, mail, pos, shopID);
    }

    @Override
    public void deleteStaffById(Integer staffId) {
        staffMapper.deleteStaffById(staffId);
    }

    @Override
    public void deleteStaffByName(String name) {
        staffMapper.deleteStaffByName(name);
    }

}